<?php
/**
 * Created by PhpStorm.
 * User: zq
 * Date: 2017/3/6
 * Time: 10:24
 */

namespace Home\Controller;



use Home\Model\AccountsModel;
use Think\Controller;

class AccountsController extends Controller
{
    public function index(){
//        p($_SESSION);
        $headConf = [
            'js'=>['accounts'],
            'css'=>['accounts'],
            'title'=>'上一天堂'
        ];
        $this->assign('headConf',$headConf);
        $AccData = (new AccountsModel())->select();
//        p($AccData);
        $this->assign('AccData',$AccData);

        $cartData = isset($_SESSION['cart']) ? $_SESSION['cart'] : [];
        $this->assign('cartData',$cartData);
        $this->display();
    }
    //添加地址
    public function add(){
        if(IS_POST){
            $data = I('post.');
//				p($data);die;
            (new AccountsModel())->add($data);
        }

    }
}